/* 
* Class name: SelectLevel *
* 
* Version info: v4.0 *
* 
* Description: Before the game is started, the level and its properties is defined here
* 
* Copyright by Group4 from CmpE450 course *
*/ 

package com.GameSpace.SameGame;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

import com.GameSpace.CoreAssets.GameManager;
import com.GameSpace.SameGame.R;

public class SelectLevel extends Activity{

	//The difficulty level Buttons
	ImageView easy;
	ImageView medium;
	ImageView hard;
	
	  @Override
	    public void onCreate( Bundle savedInstanceState ){
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.startgame);      
	        
	        //The EASY level button is shown
	        easy = (ImageView)findViewById(R.id.imgEasy);
	        easy.setOnClickListener(new OnClickListener() {
	        	
	        	//sets the level EASY when the EASY button is clicked
	        	public void onClick(View v) {
	        		GameManager.setLevel(GameManager.EASY);
	        		Intent StartGameIntent = new Intent(SelectLevel.this, StartGame.class);
	        		startActivity(StartGameIntent);
	        	}
	        });
	        
	      //The MEDIUM level button is shown
	        medium  = (ImageView)findViewById(R.id.imgMedium);
	        medium.setOnClickListener(new OnClickListener() {
	        	
	        	//sets the level MEDIUM when the MEDIUM button is clicked
	        	public void onClick(View v) {
	        		GameManager.setLevel(GameManager.MEDIUM);
	        		Intent HelpIntent = new Intent(SelectLevel.this, StartGame.class);
	        		startActivity(HelpIntent);
	        	}
	        });
	        
	        //The HARD level button is shown
	        hard = (ImageView)findViewById(R.id.imgHard);
	        hard.setOnClickListener(new OnClickListener() {
	        
	        	//sets the level HARD when the HARD button is clicked
	        	public void onClick(View v) {
	        		GameManager.setLevel(GameManager.HARD);
	        		Intent OptionsIntent = new Intent(SelectLevel.this, StartGame.class);
	        		startActivity(OptionsIntent);
	        	}
	        });
	        ImageView Logo;
	        Logo  = (ImageView)findViewById(R.id.ImgLogo4);
	        
	        //click event handler for other company logo button
	        Logo.setOnClickListener(new OnClickListener() {	        	
	        	public void onClick(View v) {
	        		//click the class of the screen which shows other games of the company
	        		Intent GameAdsIntent= new Intent(SelectLevel.this, GameAds.class);
	        		startActivity(GameAdsIntent);
	        	}
	        });
	    }

}
